<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<head>
<!--
		Charisma v1.0.0

		Copyright 2012 Muhammad Usman
		Licensed under the Apache License v2.0
		http://www.apache.org/licenses/LICENSE-2.0

		http://usman.it
		http://twitter.com/halalit_usman
	-->
<meta charset="utf-8">
<title>友宝后台管理系统</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description"
	content="Charisma, a fully featured, responsive, HTML5, Bootstrap admin template.">
<meta name="author" content="Muhammad Usman">

<!-- The styles -->
<link id="bs-css" href="css/bootstrap-cerulean.css" rel="stylesheet">
<style type="text/css">
body {
	padding-bottom: 40px;
}

.sidebar-nav {
	padding: 9px 0;
}
.userDetailTD{text-align:right;width:180px;height:30px;}
</style>
<!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
	  <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
	<![endif]-->

<!-- The fav icon -->
<link rel="shortcut icon" href="img/favicon.ico">
<script src="js/jquery-1.7.2.min.js"></script>

</head>

<body>
<jsp:include page="/referencesHtml/jsAndCss.html"></jsp:include>
	<s:include value="header.jsp" />
	<!-- topbar ends -->
	<div class="container-fluid">
		<div class="row-fluid">
			<s:include value="left.jsp" />
			<div id="content" class="span10">
				<!-- content starts -->
				<div>
					<ul class="breadcrumb">
						<li><a href="index">主页</a> <span class="divider">/</span></li>
						<li><a href="#">设备详情</a></li>
						<%-- <li style="float:right;"><a href="terminal!returnJSP?flag=editRoles&userID=<s:property value="terminal.userId" />" >修改用户角色信息</a></li> --%>
					</ul>
				</div>
				<!-- 用户基础信息 -->
				<div class="sortable row-fluid ui-sortable">
					<div class="box span12">
						<div class="box-header well" data-original-title="">
							<h2>
								<i class="icon-edit" value="<s:property value="terminal.terminalId" />" id="terminalID"></i> 设备基本情况
							</h2>
						</div>
						<div class="box-content">
							<table style="width:100%">
                             <tbody id="terminalBase">
                                <tr>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">设备网点名称:</label></td>
                                   <td><input value="<s:property value="terminal.branch.branchName" />" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">设备名称:</label></td>
                                   <td><input value="<s:property value="terminal.name" />" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                </tr>
                                <tr>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">硬件版本号:</label></td>
                                   <td><input value="<s:property value="terminal.hardVer" />" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">软件版本号:</label></td>
                                   <td><input value="<s:property value="terminal.softVer" />" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                </tr>
                                <tr>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">外设板状态:</label></td>
                                   <s:if test="terminal.peripheralStatus==0">
                                   <td><input value="正常" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   </s:if>
                                   <s:else>
                                   <td><input value="未连接" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   </s:else>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">外设板软件版本:</label></td>
                                   <td><input value="<s:property value="terminal.peripheralSoftVer" />" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                </tr>
                                <tr>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">锁板状态:</label></td>
                                   <td><input value="<s:property value="terminal.lock" />" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">检测板状态:</label></td>
                                   <td><input value="<s:property value="terminal.check" />" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                </tr>
                                <tr>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">条码枪状态:</label></td>
                                   <s:if test="terminal.barcodeStatus==0">
                                   <td><input value="正常" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   </s:if>
                                   <s:else>
                                   <td><input value="未连接" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   </s:else>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">读卡器状态:</label></td>
                                   <s:if test="terminal.cardReadStatus==0">
                                   <td><input value="正常" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   </s:if>
                                   <s:else>
                                   <td><input value="未连接" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   </s:else>
                                </tr>
                                <tr>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">触摸屏状态:</label></td>
                                   <s:if test="terminal.touchStatus==0">
                                   <td><input value="正常" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   </s:if>
                                   <s:else>
                                   <td><input value="未连接" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   </s:else>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">联网方式:</label></td>
                                   <s:if test="terminal.networkType==0">
                                   <td><input value="联通3G" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   </s:if>
                                   <s:elseif test="terminal.networkType==1">
                                   <td><input value="移动3G" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   </s:elseif>
                                   <s:elseif test="terminal.networkType==2">
                                   <td><input value="电信3G" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   </s:elseif>
                                   <s:elseif test="terminal.networkType==3">
                                   <td><input value="移动2G" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   </s:elseif>
                                   <s:elseif test="terminal.networkType==4">
                                   <td><input value="以太网（联通3G路由器）" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   </s:elseif>
                                   <s:elseif test="terminal.networkType==5">
                                   <td><input value="以太网（外接有线）" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   </s:elseif>
                                   <s:elseif test="terminal.networkType==6">
                                   <td><input value="无线WIFI" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   </s:elseif>
                                   <s:else>
                                   <td><input value="未知" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   </s:else>
                                </tr>
                                <tr>
                                <td class="userDetailTD"><label class="control-label" for="typeahead">3G卡号:</label></td>
                                   <td><input value="<s:property value="terminal.simcardNum" />" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">登录时间:</label></td>
                                   <td><input value="<s:date name="terminal.loginTime" format="yyyy-MM-dd HH:mm:ss"/>" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                </tr>
                                <tr>
                                <td class="userDetailTD"><label class="control-label" for="typeahead">设备密码:</label></td>
                                   <td><input value="<s:property value="terminal.terminalPwd" />" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                <td class="userDetailTD"><label class="control-label" for="typeahead">管理密码:</label></td>
                                   <td><input value="<s:property value="terminal.adminPwd" />" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
<%--                                    <td class="userDetailTD"><label class="control-label" for="typeahead">修改密码:</label></td>
                                   <td><a href="Terminals!linkUpdateTerminalPwd?terminalID=<s:property value="terminal.terminalId" />">修改密码</a></td> --%>
                                </tr>
                                <tr>
                                	<td class="userDetailTD"><label class="control-label" for="typeahead">请求数:</label></td>
                                	<s:if test="terminal.toSend>0">
	                                   <td><input value="<s:property value="terminal.toSend" />" readonly="readonly" type="text" class="span4 typeahead" style="width:250px;background-color:#FF99FF" data-items="2" /></td>
                                	</s:if>
                                	<s:else>
	                                   <td><input value="<s:property value="terminal.toSend" />" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                	</s:else>
                                   <%-- <td class="userDetailTD"><label class="control-label" for="typeahead">登录时间:</label></td>
                                   <td><input value="<s:date name="terminal.loginTime" format="yyyy-MM-dd HH:mm:ss"/>" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td> --%>
                                </tr>
                                <%-- <tr>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">用户地址:</label></td>
                                   <td colspan="3"><textarea readonly="readonly" style="width:88%;"><s:property value="terminal.userProvince" />省<s:property value="terminal.userCity" />市<s:property value="terminal.userAddr" /></textarea></td>
                                </tr>
                                <tr>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">信息备注:</label></td>
                                   <td colspan="3"><textarea readonly="readonly" style="width:88%;"><s:property value="terminal.userComment" /></textarea></td>
                                </tr> --%>
                             </tbody>
                           </table>
						</div>
					</div>
				</div>
				<!-- 用户账户信息 -->
				<div class="sortable row-fluid ui-sortable">
					<div class="box span12">
						<div class="box-header well" data-original-title="">
							<h2>
								<i class="icon-edit"></i> 箱格情况
							</h2>
						</div>
						<div class="box-content">
							<table style="width:100%">
                             <tbody id="boxStatus">
                                <tr>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">箱格总数:</label></td>
                                   <td><input value="<s:property value="boxDetails.boxes" />" readonly="readonly" type="text" class="span4 typeahead " style="width:250px;" data-items="2" /></td>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">故障/锁定:</label></td>
                                   <td><input value="<s:property value="boxDetails.problem" />/<s:property value="boxDetails.locked" />" readonly="readonly" type="text" class="typeahead" style="width:240px;" data-items="2" /></td>
                                </tr>
                                <tr>
								   <td class="userDetailTD"><label class="control-label" for="typeahead">空闲柜:</label></td>
                                   <td><input value="<s:property value="boxDetails.noUse" />" readonly="readonly" type="text" class="typeahead" style="width:240px;" data-items="2" /></td>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">已使用柜:</label></td>
                                   <td><input value="<s:property value="boxDetails.used" />" readonly="readonly" type="text" class="typeahead" style="width:240px;" data-items="2" /></td>
                                </tr>
                                <tr>
								   <td class="userDetailTD"><label class="control-label" for="typeahead">超大:</label></td>
                                   <td><input value="<s:property value="boxDetails.bigestUsed" />/<s:property value="boxDetails.bigestNum" />" readonly="readonly" type="text" class="typeahead" style="width:240px;" data-items="2" /></td>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">大:</label></td>
                                   <td><input value="<s:property value="boxDetails.bigUsed" />/<s:property value="boxDetails.bigNum" />" readonly="readonly" type="text" class="typeahead" style="width:240px;" data-items="2" /></td>
                                </tr>
                                <tr>
								   <td class="userDetailTD"><label class="control-label" for="typeahead">中:</label></td>
                                   <td><input value="<s:property value="boxDetails.mediumUsed" />/<s:property value="boxDetails.mediumNum" />" readonly="readonly" type="text" class="typeahead" style="width:240px;" data-items="2" /></td>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">小:</label></td>
                                   <td><input value="<s:property value="boxDetails.smallUsed" />/<s:property value="boxDetails.smallNum" />" readonly="readonly" type="text" class="typeahead" style="width:240px;" data-items="2" /></td>
                                </tr>
                             </tbody>
                           </table>
						</div>
					</div>
				</div>
				<!-- 普通用户角色信息-->
				<div class="sortable row-fluid ui-sortable">
					<div class="box span12">
						<div class="box-header well" data-original-title="">
							<h2>
								<i class="icon-edit"></i> 设备查询与操作
							</h2>
						</div>
						<div class="box-content">
							<table style="width:100%">
                             <tbody>
                                <tr>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">查询电费:</label></td>
                                   <td><a href="terElecExpensesList?terminalID=<s:property value="terminal.terminalId" />&type=1">查询电费</a></td>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">查询流量:</label></td>
                                   <td><a href="ter3gExpensesList?terminalID=<s:property value="terminal.terminalId" />&type=2">查询流量</a></td>
                                </tr>
                                <tr>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">提交反向SSH:</label></td>
                                   <td><a href="Terminals!commitSSH?terminalID=<s:property value="terminal.terminalId" />">提交反向SSH</a></td>
                                   <td class="userDetailTD"><label class="control-label" for="typeahead">设备远程升级:</label></td>
                                   <td><a href="getConfUpdate?terminalId=<s:property value="terminal.terminalId" />">远程升级</a></td>
                                </tr>
                             </tbody>
                           </table>
						</div>
					</div>
				</div>
				<!-- content ends -->
			</div>
			<!--/#content.span10-->
		</div>
		<!--/fluid-row-->

		<hr>

		<s:include value="footer.jsp" />
	</div>
	<script src="js/layer/layer.js"></script>
	<script type="text/javascript">
		/* $(document).ready(function() {
			$.post("terminal!getAgentDetail?userID=" + $("#userID").attr("value"),function(v) {
                $("#agentAdmin").prepend(v);
                //console.log("agentAdmin============"+$("#agentAdmin").html());
                if($("#agentAdmin").find("input").length>0){
                	$(".agentAdmin").show();
                }
            });
			$.post("terminal!getCourierDetail?userID=" + $("#userID").attr("value"),function(v) {
                $("#courier").prepend(v);
                if($("#courier").find("input").length>2){
                	$(".courier").show();
                }
            });
			$.post("terminal!getNetAdminDetail?userID=" + $("#userID").attr("value"),function(v) {
                $("#netAdmin").prepend(v);
                //console.log("netAdmin============"+$("#netAdmin").html());
                if($("#netAdmin").find("input").length>0){
                	$(".netAdmin").show();
                }
            });
			if($(".weChatUser").find("textarea").html()!=""){
				$(".weChatUser").show();
			}
		});
		$(function(){
			var userID = $("#userID").attr("value");
			$("#editBase").live("click",function(){
			     $.layer({
		        	  title:'修改基础信息',
		              type : 2,
		              moveOut : false,
		              shade : [0.3 , '#000' , true],
		              border : [10 , 0.3 , '#000', true],
		              offset : ['20%', '20%'],
		              iframe : {
		                  src : "terminal!returnJSP?flag=editBase&userID=" + $("#userID").attr("value")
		              },	
		              area : ['1000px','600px']
		          });
	  	  	 });
			$("#editAccount").live("click",function(){
			     $.layer({
		        	  title:'修改账户信息',
		              type : 2,
		              moveOut : false,
		              shade : [0.3 , '#000' , true],
		              border : [10 , 0.3 , '#000', true],
		              offset : ['20%', '20%'],
		              iframe : {
		                  src : "terminal!returnJSP?flag=editAccount&userID=" + $("#userID").attr("value")
		              },	
		              area : ['1000px','500px']
		          });
	  	  	 });
			$("#replayMsg").live("change",function(){
				$.post("terminal!editUser?flag=editReMsg&terminal.userNorUserIsReplayMsg="+$("#replayMsg").val()+"&userID="+userID,function(){
					funtips("修改成功！！！！！");
				});
			});
			$("#userCredit").live("change",function(){
				$.post("terminal!editUser?flag=editCredit&terminal.userCredit="+$("#userCredit").val()+"&userID="+userID,function(){
					funtips("修改成功！！！！！");
				});
			});
		});
		function funtips(str){
		    //提示框
			    var i =$.layer({
				shade : [0.3 , '#000' , true],
			    area : ['240px','130px'],
			    dialog : {
			        msg:str,
			        btns : 0, 
			        type : 1
			     }
			     });
			     setTimeout(function(){layer.close(i);},1000);
		}
		//回调函数，修改基础信息。
		function   editBase(userID,lastName,firstName,sex,mobileNum,qqNum,IdCard,mailAddr,province,city,addr,comment){
			var str = "&userID="+userID+"&terminal.userLastName="+lastName+"&terminal.userFirstName="+firstName+"&terminal.userSex="+sex+"&terminal.userMobileNum="+mobileNum+"&terminal.userQqNum="+qqNum+"&terminal.userIdcard="+IdCard+"&terminal.userMailAddr="+mailAddr+"&terminal.userProvince="+province+"&terminal.userCity="+city+"&terminal.userAddr="+addr+"&terminal.userComment="+comment;
			//console.log("str============"+str);
			$.post("terminal!editUser?flag=editBase"+str,function(v){
			    //询问框
			     funtips("修改成功！！！！！");
			     $("#userBase").find("input").each(function(i){
			    	 if(i==0){
			    		 $(this).val(lastName+firstName);
			    	 }
			    	 if(i==1){
			    		 $(this).val(mobileNum);
			    	 }
			    	 if(i==2){
			    		 $(this).val(qqNum);
			    	 }
			    	 if(i==3){
			    		 $(this).val(IdCard);
			    	 }
			    	 if(i==4){
			    		 $(this).val(mailAddr);
			    	 }
			     });
			     $("#userBase").find("textarea").each(function(i){
			    	 if(i==0){
			    		 $(this).html(province+"省"+city+"市"+addr);
			    	 }
			    	 if(i==1){
			    		 $(this).html(comment);
			    	 }
			     });
			});
	     }
		//回调函数，修改账户信息。
		function   editAccount(userID,webName,webPwd,devPwd,rfid){
			var str = "&userID="+userID+"&terminal.userWebName="+webName+"&terminal.userWebPwd="+webPwd+"&terminal.userDevPwd="+devPwd+"&terminal.userRfid="+rfid;
			$.post("terminal!editUser?flag=editAccount"+str,function(v){
			    //询问框
			     funtips("修改成功！！！！！");
			     $("#userAccount").find("input").each(function(i){
			    	 console.log(i);
			    	 if(i==0){
			    		 $(this).val(webName);
			    	 }
			    	 if(i==1){
			    		 $(this).val(webPwd);
			    	 }
			    	 if(i==2){
			    		 $(this).val(rfid);
			    	 }
			    	 if(i==3){
			    		 $(this).val(devPwd);
			    	 }
			     });
			});
	     } */
	</script>
</body>
</html>
